#include "db_query.h"

DBQuery::DBQuery(QObject *parent) : QObject(parent)
{

}

bool DBQuery::init(QString ip, QString port, QString user, QString pwd)
{
    dbClient = new DBClient();
    //    dataDbClient = new DBClient();
    //    dataDbClient->Connect(ip,port,user,pwd);
    return dbClient->Connect(ip,port,user,pwd);
}

QList<DeptNode> DBQuery::selectDeptQuery(QString sql)
{
    return dbClient->selectDeptQuery(sql);
}

QMap<QString, QString> DBQuery::selectLoginQuery(QString sql)
{
    return dbClient->selectLoginQuery(sql);
}

QList<QList<QString> > DBQuery::select(QString sql)
{
    return dbClient->select(sql);
}

bool DBQuery::insertQuery()
{
    return 1;
}

bool DBQuery::deleteQuery()
{
    return 1;
}

bool DBQuery::updateQuery()
{
    return 1;
}

QSqlDatabase DBQuery::getDataDBClient()
{
    return dataDbClient->getDataDBClient();
}
